<%@ page contentType="text/xml;charset=UTF-8" language="java"%>
<%@ page import="java.util.List"%>
<%@ page import="org.dualr.litelog.entity.Post"%>
<%@ page import="org.dualr.litelog.utils.LiteLogUtil"%>
<%
	String url = "";
	String title = "";
	String mail = "";
	String description = "";
	String date = "";
	url = LiteLogUtil.getInstance().getPropsValue("/litelog.properties", "litelog.url");
	title = LiteLogUtil.getInstance().getPropsValue("/litelog.properties", "litelog.title");
	mail = LiteLogUtil.getInstance().getPropsValue("/litelog.properties", "litelog.mail");
	description = LiteLogUtil.getInstance().getPropsValue("/litelog.properties", "litelog.description");
%>
<rss version="2.0">
<channel>
<title><%=title%></title>
<link><%=url%></link>
<description><%=description%></description>
<image> <url>favicon.png</url>
<title><%=title%></title>
<link><%=url%></link>
</image>
<%
if (request.getAttribute("PostList") != null){
	List<Post> postList = (List<Post>) request.getAttribute("PostList");
	for(Post post : postList){
		%>
		<item>
		<title><![CDATA[<%=post.getTitle()%>]]></title>
		<link><![CDATA[<%=url%>/post?method=view&id=<%=post.getId()%>]]></link>
		<description><![CDATA[<%=post.getContent().getValue()%>]]></description>
		<pubDate><![CDATA[<%=LiteLogUtil.getInstance().formateDate(post.getPostDate(), "yyyy-MM-dd a")%>]]></pubDate>
		<author><%=mail%></author>
		<guid><%=url%></guid>
		</item>
		<%
	}
}
%>
</channel>
</rss>
